﻿using System.ServiceModel;
using JTLeigh.Commerce.Spencer.Core.Service.Contracts;
using JTLeigh.Commerce.Spencer.Features.ProductFeedback.Service.Contracts.Runtime.GetProductFeedback;
using JTLeigh.Commerce.Spencer.Features.ProductFeedback.Service.Contracts.Runtime.GetProductFeedbackSnapshot;
using JTLeigh.Commerce.Spencer.Features.ProductFeedback.Service.Contracts.Runtime.GetProductFeedbackSummaries;

namespace JTLeigh.Commerce.Spencer.Features.ProductFeedback.Service.Contracts
{

	/// <summary>
	/// WCF service interface for the Product Feedback Runtime service.
	/// </summary>
    [ServiceContract(Name = "ProductFeedbackRuntimeService", Namespace = "http://schemas.jtleigh.com/Commerce/Spencer/Features/ProductFeedback/1.0/")]
	public interface IProductFeedbackRuntimeService
	{

		#region Methods

		/// <summary>
		/// Gets all feedback for a single product, including all ratings, recommendations, 
		/// reviews, and relevant attribute metadata.
		/// </summary>
		/// <param name="request">The <see cref="GetProductFeedbackRequest"/> request object.</param>
		/// <returns>The <see cref="GetProductFeedbackResponse"/> response object.</returns>
		[OperationContract(Name = "GetProductFeedback")]
        [FaultContract(typeof(InternalErrorFault))]
        GetProductFeedbackResponse GetProductFeedback(GetProductFeedbackRequest request);

		/// <summary>
		/// Gets a snapshot of the feedback for a single product, including total and average 
		/// ratings, rating breakdowns, total and positive recommendations, total reviews, and
		/// relevant attribute metadata.
		/// </summary>
		/// <param name="request">The <see cref="GetProductFeedbackSnapshotRequest"/> request 
		/// object.</param>
		/// <returns>The <see cref="GetProductFeedbackSnapshotResponse"/> response object.</returns>
		[OperationContract(Name = "GetProductFeedbackSnapshot")]
        [FaultContract(typeof(InternalErrorFault))]
        GetProductFeedbackSnapshotResponse GetProductFeedbackSnapshot(GetProductFeedbackSnapshotRequest request);

		/// <summary>
		/// Gets summaries of the feedback for multiple products, including total and average
		/// ratings, total and positive recommendations, and total reviews.
		/// </summary>
		/// <param name="request">The <see cref="GetProductFeedbackSummariesRequest"/> request
		/// object.</param>
		/// <returns>The <see cref="GetProductFeedbackSummariesResponse"/> response object.</returns>
		[OperationContract(Name = "GetProductFeedbackSummaries")]
        [FaultContract(typeof(InternalErrorFault))]
        GetProductFeedbackSummariesResponse GetProductFeedbackSummaries(GetProductFeedbackSummariesRequest request);

		#endregion // Methods

	}

}
